#pragma once

#include "Frame.hpp"




class ENGINE_UI_API ProgressBar : public Frame
{
private:

	int           m_min;
	int           m_max;
	int           m_current;

	math::color   m_barColor;

public:

	/**
	 * Create a ProgressBar Widget.
	 */
	ProgressBar(Widget* parent, Widgets::Type finalType = Widgets::ProgressBar);

	/**
	 * Destroy this ProgressBar Widget.
	 */
	virtual ~ProgressBar();


	/**
	 * Get the minimum value of this ProgressBar.
	 */
	int min() const;

	/**
	 * Get the maximum value of this ProgressBar.
	 */
	int max() const;

	/**
	 * Get the current value of this ProgressBar.
	 */
	int current() const;



	/**
	 * Set the minimum value of this ProgressBar.
	 */
	void setMin(int min);

	/**
	 * Set the maximum value of this ProgressBar.
	 */
	void setMax(int max);

	/**
	 * Set the current value of this ProgressBar.
	 */
	void setCurrent(int cur);



	/**
	 * Get the color of the bar.
	 */
	math::color barColor() const;

	/**
	 * Set the color of the bar.
	 */
	void setBarColor(const math::color& color);

protected:

	/**
	 * Get the type of this widget.
	 */
	virtual Widgets::Type type() const;

	/**
	 * Renders the additional widgets for this window (text, buttons, etc...).
	 */
	virtual void renderAdditional(Quads& quads, const NestedState& state);

	/**
	 * Calculate how many quads need to be rendered to visualize this window.
	 *
	 * @return obviously the number of quads
	 */
	virtual uint32 numAdditionalQuads() const;
};
///////////////////////////////////////////////////////////////////////////////////////////////////
